import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    name:'home',
    component:HomeView,
    redirect: '/home/one',
    children: [
      {
        path: 'one',
        name: 'one',
        component: () => import('../views/OneView.vue')
      },
      {
        path: 'oneChild',
        name: 'oneChild',
        component: () => import('../views/OneChild.vue')
      },
      {
        path: 'two',
        name: 'two',
        component: () => import('../views/TwoView.vue')
      },
      {
        path: 'twoChild',
        name: 'twoChild',
        component: () => import('../views/TwoChild.vue')
      },
      {
        path: 'three',
        name: 'three',
        component:()=> import('../views/ThreeView.vue')
      },
      {
        path: 'threeChild',
        name: 'threeChild',
        component:()=> import('../views/ThreeChild.vue')
      },
      {
        path: 'four',
        name: 'four',
        component:()=> import('../views/FourView.vue')
      },
      {
        path: 'fourChild',
        name: 'fourChild',
        component:()=> import('../views/FourChild.vue')
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
